package org.yookiee.support.config;

import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.yookiee.support.config.aspect.I18NAspect;
import org.yookiee.support.toolkits.SpringContextToolkit;

/**
 * FileName DefaultConfig
 * Package org.yookiee.support.config
 * Description
 * author cpstory
 * create 2023-11-30 10:20
 * version V1.0
 */
@Data
@Configuration
@Import(value = {EasyI18nProperties.class, SpringContextToolkit.class, I18NAspect.class})
@ConditionalOnProperty(prefix = "easy-i18n", name = "defaultConfig")
public class DefaultConfig {

    private String timezone;//config default timezone
    private String language;//config default language

    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
        PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
        configurer.setFileEncoding("UTF-8");
        return configurer;
    }
}
